import { TSuitSkillUpgrade } from "../../../Message/Db/Tables/TSuitSkillUpgrade";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class SuitSkillUpgradeConfig
    
    export  class SuitSkillUpgradeConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (SuitSkillUpgradeConfig._instance != null) 
            {
                throw new Error(" SuitSkillUpgradeConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TSuitSkillUpgrade();
                loc1.id = loc2.id;
                loc1.level = loc2.level;
                loc1.accumulation = loc2.accumulation;
                this._map[loc1.level] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_suit_skill_upgrade.json");
            this.write(loc1);
            return;
        }

        public getConfigByLevel(arg1: int): TSuitSkillUpgrade
        {
            return this._map[arg1];
        }

        public getMaxAccumulationByLevel(arg1: int): int
        {
            var loc1=this._map[arg1];
            if (loc1) 
            {
                return loc1.accumulation;
            }
            return 0;
        }

        public static get instance(): SuitSkillUpgradeConfig
        {
            if (SuitSkillUpgradeConfig._instance == null) 
            {
                SuitSkillUpgradeConfig._instance = new SuitSkillUpgradeConfig();
            }
            return SuitSkillUpgradeConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: SuitSkillUpgradeConfig;
    }
